<template>
  <el-container v-loading="loading" element-loading-background="rgba(0, 0, 0, 0.8)"  direction="vertical" class="b">
    <iframe id="myiframe" frameborder="0"></iframe>
  </el-container>
</template>

<script>
export default {
  name: "scratch",
  mounted() {
    this.init();
  },
  watch: {
    $route() {
      this.init();
    }
  },
  data() {
    return {
      loading: true
    };
  },
  methods: {
    init() {
      if(process.env.NODE_ENV !== 'production') {
        this.loading = false;
        return
      }
      this.loading = true;
      let iframe = document.getElementById("myiframe");
      iframe.src = scratchpath;
      iframe.onload = () => {
        this.loading = false;
      };
    }
  }
};
</script>

<style>
iframe {
  height: 100%;
}
</style>
